package com.moxiao.yfjh.module.blind.dal.mysql.recommendSetting;

import com.moxiao.yfjh.module.blind.controller.admin.recommendSetting.vo.RecommendSettingExportReqVO;
import com.moxiao.yfjh.module.blind.controller.admin.recommendSetting.vo.RecommendSettingPageReqVO;
import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.recommendSetting.RecommendSettingDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.recommendSetting.vo.*;

/**
 * 相亲超级推荐设置 Mapper
 *
 * @author mx
 */
@Mapper
public interface RecommendSettingMapper extends BaseMapperX<RecommendSettingDO> {

    default PageResult<RecommendSettingDO> selectPage(RecommendSettingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecommendSettingDO>()
                .eqIfPresent(RecommendSettingDO::getNum, reqVO.getNum())
                .eqIfPresent(RecommendSettingDO::getMoney, reqVO.getMoney())
                .eqIfPresent(RecommendSettingDO::getTimeLimit, reqVO.getTimeLimit())
                .eqIfPresent(RecommendSettingDO::getBuyExplain, reqVO.getBuyExplain())
                .eqIfPresent(RecommendSettingDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(RecommendSettingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RecommendSettingDO::getId));
    }

    default List<RecommendSettingDO> selectList(RecommendSettingExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<RecommendSettingDO>()
                .eqIfPresent(RecommendSettingDO::getNum, reqVO.getNum())
                .eqIfPresent(RecommendSettingDO::getMoney, reqVO.getMoney())
                .eqIfPresent(RecommendSettingDO::getTimeLimit, reqVO.getTimeLimit())
                .eqIfPresent(RecommendSettingDO::getBuyExplain, reqVO.getBuyExplain())
                .eqIfPresent(RecommendSettingDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(RecommendSettingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RecommendSettingDO::getId));
    }

}
